﻿using System;
using System.Collections.Generic;
using System.Web;
using SiteServer.Plugin;
using Thingpower.SS.EduOnline.BackgroundPages;
using Thingpower.SS.EduOnline.Provider;

namespace Thingpower.SS.EduOnline
{
    public class EduOnlinePlugin : PluginBase
    {
        public const string PluginId = "Thingpower.SS.EduOnline";

        internal static EduOnlinePlugin Instance { get; private set; }

        public override void Startup(IService service)
        {
            
            service
                .AddDatabaseTable(EnrollmentDAO.TableName, EnrollmentDAO.Columns)
                .AddDatabaseTable(StudyLogDAO.TableName, StudyLogDAO.Columns)
                .AddSystemMenu(new Menu
                {
                    Text = "网校管理",
                    Menus = new List<Menu>
                    {
                        new Menu
                        {
                            Text = "网校设置",
                            Href = $"BackgroundPages/{nameof(PageSettings)}.aspx"
                        },
                        new Menu
                        {
                            Text = "数据统计",
                            Href = $"BackgroundPages/{nameof(PageDashboard)}.aspx"
                        }
                    }
                })
                ;

            Instance = this;

        }
    }
}